<template>
    <view :style="themeColor">
        <view class="page" >
    <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex chapterDetails_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center justify-between chapterDetails_fd0_0'      >
            <view   class='flex flex-wrap align-center chapterDetails_fd0_0_c0'   @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <text class='fu-iconfont2  chapterDetails_fd0_0_c0_c0'  >&#xE794;</text>
</view>
    <view   class='flex flex-wrap align-center'      >
        <text class='chapterDetails_fd0_0_c1_c0'  >章节详情</text>
</view>
    <view   class='flex align-center justify-end chapterDetails_fd0_0_c0'      >
        </view>
</view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---flex布局flex布局开始-->
 <view class="flex benben-flex-layout flex-wrap align-center"    >
                    
            <video class='flex  chapterDetails_fd1_0'  :poster="detailsData.shipin.thumb" :src="detailsData.shipin.path" controls='true' x5-video-player-type="h5" :enable-progress-gesture='true' object-fit="fill"     ></video>
            
</view>
        
<!---flex布局flex布局结束-->
<!---flex布局flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout chapterDetails_flex_2"    >
        <text class='chapterDetails_fd2_0'  >{{detailsData.wenben}}</text>
</view>
        
<!---flex布局flex布局结束-->
<!---flex布局flex布局开始-->
 <view class="flex benben-flex-layout flex-wrap align-center chapterDetails_flex_3"    >
            <view   class='flex flex-wrap align-center'      >
        <image class='chapterDetails_fd3_0_c0'  mode="aspectFill"  :src='STATIC_URL+"116.png"'></image>
<text class='chapterDetails_fd3_0_c1'  >章节介绍</text>
</view>
</view>
        
<!---flex布局flex布局结束-->
<!---flex布局flex布局开始-->
 <view class="flex benben-flex-layout flex-wrap align-center chapterDetails_flex_4"    >
                <jyf-parser class='chapterDetails_fd4_0'  :html="detailsData.describe | richTextFormat"  >
        </jyf-parser>
</view>
        
<!---flex布局flex布局结束-->
    <view class="flex flex-wrap align-start justify-center benben-position-layout flex chapterDetails_flex_5"    >
        <button class='chapterDetails_fd5_0'  @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/my/addChapter/addChapter?course_id=${detailsData.freexianshangkecheng_id}&chapter_id=${detailsData.aid}`"  >编辑</button>
<button class='chapterDetails_fd5_1'  @tap.stop="deleteFunc()"  >删除</button>

        </view>
<view :style="{height: '120rpx'}"  ></view>
    
    
        </view>
    </view>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    
    export default {
        components:{},
        
        
        data(){
			return {"detailsData":{"aid":"","freexianshangkecheng_id":"","wenben":"","cover":"","describe":"","shipin":{"name":"","path":"","thumb":"","mime":"","duration":""}},"id":""};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            let {id}=options
if (id !== undefined) this.id = id
this.getDetailsFunc()
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //获取章节详情
                async getDetailsFunc(){
                        //请求方法
    //数据验证
    
  let datadetailsData = await this.$api.get(global.apiUrls.post6525032bb47ac, {
    aid:this.id
  });
  
  if (datadetailsData.data.code != 1) {
    this.$message.info(datadetailsData.data.msg);
    return
  } 
  let infodetailsData = datadetailsData.data;
  this.detailsData = infodetailsData.data
  
                },
                //删除章节
                async deleteFunc(){
                        //请求方法
    //数据验证
    
  let data652507e1d29e4 = await this.$api.get(global.apiUrls.post652507e1d29e4, {
    aid:this.id
  });
  
  if (data652507e1d29e4.data.code != 1) {
    this.$message.info(data652507e1d29e4.data.msg);
    return
  } 
  
  
  
                    this.$message.info('删除成功');
                setTimeout(()=>{
                    this.$urouter.navigateBack(1);
      },500)
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:#fff;background-size: 100% auto;
        }
    .chapterDetails_flex_0{
        border-bottom:1px solid #eee;background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .chapterDetails_fd0_0_c1_c0{
        font-size:36rpx;font-weight:500;color:#333333;
    }
    .chapterDetails_fd0_0_c0_c0{
        font-size:36rpx;color:#333;font-weight:500;
    }
    .chapterDetails_fd0_0_c0{
        width:100rpx;
    }
    .chapterDetails_fd0_0{
        padding:0rpx 32rpx 0rpx 32rpx;line-height:88rpx;
    }
    .chapterDetails_fd1_0{
        width:750rpx;height:500rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
    }
    .chapterDetails_flex_2{
        padding:32rpx 32rpx 24rpx 32rpx;
    }
    .chapterDetails_fd2_0{
        font-size:32rpx;font-weight:700;color:#333;
    }
    .chapterDetails_flex_3{
        border-top:10px solid rgba(248, 248, 248, 1);padding:32rpx 32rpx 15rpx 32rpx;
    }
    .chapterDetails_fd3_0_c1{
        font-size:32rpx;font-weight:700;color:#333;margin:0rpx 0rpx 0rpx 16rpx;
    }
    .chapterDetails_fd3_0_c0{
        width:6rpx;height:28rpx;border-radius:3rpx 3rpx 3rpx 3rpx;
    }
    .chapterDetails_flex_4{
        padding:0rpx 32rpx 0rpx 32rpx;
    }
    ::v-deep .chapterDetails_fd4_0{
        width:100%;
    }
    .chapterDetails_flex_5{
        width:750rpx;height:120rpx;overflow:hidden;z-index:10;bottom:calc(0rpx + var(--window-bottom));
    }
    .chapterDetails_fd5_1{
        background:#E31D1A;border-radius:44rpx 44rpx 44rpx 44rpx;font-size:32rpx;color:#fff;width:320rpx;height:88rpx;line-height:88rpx;
    }
    .chapterDetails_fd5_0{
        background:#E31D1A;border-radius:44rpx 44rpx 44rpx 44rpx;font-size:32rpx;color:#fff;width:320rpx;height:88rpx;line-height:88rpx;margin:0rpx 32rpx 0rpx 0rpx;
    }
</style>